
package com.be.beadmin.design.repository;

import com.be.beadmin.design.entity.StandFileInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
* @author Jiahao Liu
* @date 2023-02-16
**/
public interface StandFileInfoRepository extends JpaRepository<StandFileInfo, String>, JpaSpecificationExecutor<StandFileInfo> {

    StandFileInfo findStandFileInfoByIdAndDelete(String id, Integer delete);

    StandFileInfo findStandFileInfoByFileCodeAndDelete(String fileCode, Integer delete);


    StandFileInfo findStandFileInfoByCategoryAndFileCodeAndDelete(String category,String fileCode, Integer delete);

    Page<StandFileInfo> findAllByDelete(Integer delete, Pageable pageable);

    StandFileInfo findStandFileInfoById(String id);

    StandFileInfo findStandFileInfoByFileCode(String fileCode);

    List<StandFileInfo> findStandFileInfoByStandTypeCodeAndCategoryAndDelete(String standTypeCode, String category, Integer delete);

    List<StandFileInfo> findStandFileInfoByStandTypeCode(String standTypeCode);

    StandFileInfo findStandFileInfoByFileName(String fileName);

    StandFileInfo findStandFileInfoByFileNameAndDelete(String fileName, Integer delete);

    StandFileInfo findStandFileInfoByStandTypeIdAndCategoryAndStatusAndDelete(String standTypeId, String category, Integer status, Integer delete);

    List<StandFileInfo> findStandFileInfosByStandTypeIdAndCategoryAndStatusAndDelete(String standTypeId, String category, Integer status, Integer delete);


    StandFileInfo findStandFileInfoByStandTypeIdAndCategoryAndFileNameAndDelete(String standTypeId, String category, String fileName, Integer delete);

    List<StandFileInfo> findStandFileInfoByStandTypeIdAndCategoryInAndStatusAndDelete(String standTypeId, List<String> category, Integer status, Integer delete);


    List<StandFileInfo> findStandFileInfosByStandTypeIdAndCategoryAndFileNameAndDelete(String standTypeId, String category, String fileName, Integer delete);

    List<StandFileInfo> findStandFileInfoByStandTypeIdAndDelete(String StandTypeId, Integer delete);

}